import { create } from 'zustand'

interface CounterState {
    count: number
    increase: () => void
    decrease: () => void
}

const createCountStore = create<CounterState>((set) => {
    return {
        count: 0,
        increase: () => set((state) => ({ count: state.count + 1 })),
        decrease: () => set((state) => ({ count: state.count - 1 }))
    }
})

export default createCountStore
